package com.aishua.andpaydemo.fragment.caifufragment;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.aishua.andpaydemo.ImageloaderHelper;
import com.aishua.andpaydemo.R;
import com.aishua.andpaydemo.fragment.BaseFragment;

/**
 * Created by aishua on 2018/5/16.
 */

public class JiekuanFragment extends BaseFragment {

    private TextView tv_benqihuankuan;
    private TextView tv_kejieedu;
    private ImageView img_woyaodaikuan;
    private ImageView img_zhuigaokejie;
    private ImageView img_xinyongjigou;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        super.onCreateView(inflater,container,savedInstanceState);
        View view = View.inflate(getContext(), R.layout.fragment_jiekuan,null);
        initTitleView(view);
        initView(view);
        initViewData();
        return view;

    }


    private void initTitleView(View view) {

        tv_benqihuankuan =view.findViewById(R.id.tv_benqihuankuan);
        tv_kejieedu =view.findViewById(R.id.tv_kejieedu);

    }
    private void initView(View view) {

        img_woyaodaikuan = view.findViewById(R.id.img_woyaodaikuan);
        ImageloaderHelper.dispalyImage(mContext,R.drawable.woyaodaikuan,img_woyaodaikuan);
        img_zhuigaokejie =view.findViewById(R.id.img_zhuigaokejie);
        ImageloaderHelper.dispalyImage(mContext,R.drawable.zhuigaokejie,img_zhuigaokejie);
        img_xinyongjigou =view.findViewById(R.id.img_xinyongjigou);
        ImageloaderHelper.dispalyImage(mContext,R.drawable.xinyongjigou,img_xinyongjigou);

    }
    private void initViewData() {

        String str="本期还款：（元）"+"\n"+"12345";
        tv_benqihuankuan.setTextSize(18);
//        tv_zonzichan.setText(Html.fromHtml(str));
        tv_benqihuankuan.setText(str);
        String str1="可借额度：（元）"+"\n"+"345.67";
        tv_kejieedu.setTextSize(18);
//        tv_zonzichan.setText(Html.fromHtml(str1));
        tv_kejieedu.setText(str1);
    }

}
